package dataTypesPackage;

import dataConnectionPackage.Facade;

public class Gemi {
	private int gemiID;
	private String name;
	private int kamaraSayisi;
	private int siviKargoAlaniSayisi;
	private int katiKargoAlaniSayisi;
	private Ulke ulke;
	private Liman bulunduguLiman;
	private Kaptan gemiKaptani;
	private boolean isVisible;
	
	
	public Gemi() {
		gemiID=0;
		name="default";
		kamaraSayisi=1;
		siviKargoAlaniSayisi=1;
		katiKargoAlaniSayisi=1;
		ulke = new Ulke();
		bulunduguLiman = new Liman();
		gemiKaptani = new Kaptan();
		isVisible=true;				
	}

	public Gemi(int gemiID, String name, int kamaraSayisi, int siviKargoAlaniSayisi,
			int katiKargoAlaniSayisi, Ulke ulke, Liman bulunduguliman, Kaptan gemiKaptani) {
		super();
		this.gemiID = gemiID;
		this.name = name;
		this.kamaraSayisi = kamaraSayisi;
		this.siviKargoAlaniSayisi = siviKargoAlaniSayisi;
		this.katiKargoAlaniSayisi = katiKargoAlaniSayisi;
		this.ulke = ulke;
		this.bulunduguLiman = bulunduguliman;
		this.gemiKaptani = gemiKaptani;
		isVisible=true;
	}
	//gemi = gemiID,name,kamaraSayisi,sKargosayisi,kKargoSayisi,UlkeID,bulunduguLimanID,kaptanID,isVisible
	public Gemi(int gemiID, String name, int kamaraSayisi, int siviKargoAlaniSayisi,
			int katiKargoAlaniSayisi, int ulkeID, int bulunduguLimanID, int kaptanID) {
		// for creating from database return values
		super();
		this.gemiID = gemiID;
		this.name = name;
		this.kamaraSayisi = kamaraSayisi;
		this.siviKargoAlaniSayisi = siviKargoAlaniSayisi;
		this.katiKargoAlaniSayisi = katiKargoAlaniSayisi;
		this.ulke = (Ulke) Facade.getInstance().get(ulkeID, Ulke.class);
		this.bulunduguLiman = (Liman) Facade.getInstance().get(bulunduguLimanID,Liman.class);
		this.gemiKaptani = (Kaptan) Facade.getInstance().get(kaptanID,Kaptan.class);
		isVisible=true;
	}

	public int getGemiID() {
		return gemiID;
	}
	public void setGemiID(int gemiID) {
		this.gemiID = gemiID;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getKamaraSayisi() {
		return kamaraSayisi;
	}
	public void setKamaraSayisi(int kamaraSayisi) {
		this.kamaraSayisi = kamaraSayisi;
	}
	public int getKatiKargoAlaniSayisi() {
		return katiKargoAlaniSayisi;
	}
	public void setKatiKargoAlaniSayisi(int kargoAlaniSayisi) {
		this.katiKargoAlaniSayisi = kargoAlaniSayisi;
	}
	public int getSiviKargoAlaniSayisi() {
		return siviKargoAlaniSayisi;
	}
	public void setSiviKargoAlaniSayisi(int kargoAlaniSayisi) {
		this.siviKargoAlaniSayisi = kargoAlaniSayisi;
	}
	public Ulke getUlke() {
		return ulke;
	}
	public void setUlke(Ulke ulke) {
		this.ulke = ulke;
	}
	public Liman getBulunduguliman() {
		return bulunduguLiman;
	}
	public void setBulunduguliman(Liman bulunduguliman) {
		this.bulunduguLiman = bulunduguliman;
	}

	public void setGemiKaptani(Kaptan gemiKaptani) {
		this.gemiKaptani = gemiKaptani;
	}

	public Kaptan getGemiKaptani() {
		return gemiKaptani;
	}

	public void setVisible(boolean isVisible) {
		this.isVisible = isVisible;
	}

	public boolean isVisible() {
		return isVisible;
	}

	@Override
	public String toString() {
		return name;
	}
	
	
	
	
	
	
	

}
